home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-09-24 | 3.4 KB | 127 lines | [TEXT/R*ch] |
- /*
- entry.S
- the entry point for PowerOS
- copyright 1996-1997 by Ben Martz
- all rights reserved world wide
-
- ANY AND ALL MODIFICATIONS TO THIS SOURCE MUST CREDIT THE ORIGINAL
- AUTHOR, BEN MARTZ (benmartz@ic.net), AND MUST BE GIVEN TO THE AUTHOR
- FOR INTEGRATION INTO THE MAIN PowerOS SOURCE TREE. THANK YOU FOR YOUR
- COOPERATION!
- */
-
- #include "stdhdr.s"
- #include "exception_stub.s"
-
- /******************************************************************************/
-
- .text
- .globl _start
- _start:
- /* adjust the MSR, just to make sure it's okay */
- lis r31,MSR_KERNEL@h
- ori r31,r31,MSR_KERNEL@l
- mtmsr r31
- sync
-
- /* jump over the exception handlers to the real _start */
- lis r31,_start2@ha
- ori r31,r31,_start2@l
- mtlr r31
- blr
-
- /******************************************************************************/
-
- exception(0x00100,_SystemReset)
- exception(0x00200,_MachineCheck)
- exception(0x00300,_DataStorage)
- exception(0x00400,_InstructionStorage)
- exception(0x00500,_External)
- exception(0x00600,_Alignment)
- exception(0x00700,_Program)
- exception(0x00800,_FPUnavailable)
- exception(0x00900,_Decrementer)
- exception(0x00a00,_IOException)
- exception(0x00b00,_UnknownException)
- exception(0x00c00,_SystemCall)
- exception(0x00d00,_Trace)
- exception(0x00e00,_FPAssist)
- exception(0x00f00,_UnknownException)
- exception(0x01000,_UnknownException)
- exception(0x01100,_UnknownException)
- exception(0x01200,_UnknownException)
- exception(0x01300,_UnknownException)
- exception(0x01400,_UnknownException)
- exception(0x01500,_UnknownException)
- exception(0x01600,_UnknownException)
- exception(0x01700,_UnknownException)
- exception(0x01800,_UnknownException)
- exception(0x01900,_UnknownException)
- exception(0x01a00,_UnknownException)
- exception(0x01b00,_UnknownException)
- exception(0x01c00,_UnknownException)
- exception(0x01d00,_UnknownException)
- exception(0x01e00,_UnknownException)
- exception(0x01f00,_UnknownException)
- exception(0x02000,_UnknownException)
- exception(0x02100,_UnknownException)
- exception(0x02200,_UnknownException)
- exception(0x02300,_UnknownException)
- exception(0x02400,_UnknownException)
- exception(0x02500,_UnknownException)
- exception(0x02600,_UnknownException)
- exception(0x02700,_UnknownException)
- exception(0x02800,_UnknownException)
- exception(0x02900,_UnknownException)
- exception(0x02a00,_UnknownException)
- exception(0x02b00,_UnknownException)
- exception(0x02c00,_UnknownException)
- exception(0x02d00,_UnknownException)
- exception(0x02e00,_UnknownException)
- exception(0x02f00,_UnknownException)
-
- /******************************************************************************/
-
- . = 0x03000
- .globl _start2
- _start2:
- /* move to the kernel stack */
- lis r31,kernel_stack@ha
- ori r31,r31,kernel_stack@l
- mr r1,r31
-
- /* let's do the rest in C */
- /* put the ppc chip type into r4 */
- /* kvars are already in r3 */
- mfspr r4,PVR
- rlwinm r4,r4,16,16,31
- lis r31,kernel_main@ha
- ori r31,r31,kernel_main@l
- lis r30,MSR_KERNEL@h
- ori r30,r30,MSR_KERNEL@l
- mtsrr0 r31
- mtsrr1 r30
- rfi
-
- /******************************************************************************/
-
- /* this is a failsafe - we should never reach here! */
- _forever:
- nop
- b _forever
-
- /******************************************************************************/
-
- .data
-
- .align 4
- .space 8192 /* 8K is reasonable for a OS stack */
- .globl kernel_stack
- kernel_stack:
- nop /* remember, a stack pointer points at the top! */
-
- .align 4
- .globl exception_frame
- exception_frame:
- .space 1024 /* more than enough for all the registers */
-